﻿using RuoVea.ExDto;
using RuoVea.ExSugar.Attributes;
using System.ComponentModel.DataAnnotations;

namespace RuoVea.OmiApi.Article.Service.Dto;

/// <summary>
/// 
/// </summary>
public class CommentParam : PageParam
{
    /// <summary>
    /// 父评论Id，0表示一级评论
    /// </summary>
    public long PId { get; set; } = 0;

    /// <summary>
    /// 文章ID
    /// </summary>
    public long ArticleId { get; set; }

    /// <summary>
    /// 创建者Id
    /// </summary>
    public long Creator { get; set; }

    /// <summary>
    /// 评论内容
    /// </summary>
    public string Content { get; set; }

    /// <summary>
    /// 点赞数
    /// </summary>
    public long LikeCount { get; set; } = 0;

    /// <summary>
    /// 状态：0-待审核，1-已发布，2-已删除
    /// </summary>
    public int? Status { get; set; } = 0;

    /// <summary>
    /// 
    /// </summary>
    private int _currentPage;
    /// <summary>
    /// 
    /// </summary>
    public int CurrentPage
    {
        get { return _currentPage; }
        set
        {
            _currentPage = value;
            base.PageNo = value;
        }
    }

}
/// <summary>
/// 
/// </summary>
public class CommentDto  
{
    /// <summary>
    /// 主键Id
    /// </summary>
    public long Id { get; set; }

    /// <summary>
    /// 父评论Id，0表示一级评论
    /// </summary>
    public long PId { get; set; } = 0;

    /// <summary>
    /// 文章ID
    /// </summary>
    public long ArticleId { get; set; }

    /// <summary>
    /// 创建者Id
    /// </summary>
    public long Creator { get; set; }

    /// <summary>
    /// 评论内容
    /// </summary>
    [Required]
    public string Content { get; set; }

    /// <summary>
    /// 点赞数
    /// </summary>
    public long LikeCount { get; set; } = 0;

    /// <summary>
    /// 状态：0-待审核，1-已发布，2-已删除
    /// </summary>
    public int Status { get; set; } = 0;

}
